<template>
  <ych-modal
    :fullscreen="false"
    :title="title"
    :visible="visible"
    :destroyOnClose="true"
    @cancel="handleCancel">
    <a-tabs size="small" v-model="activeKey" @change="handleChange">
      <a-tab-pane :tab="$t('m.eform.appgroup.other.current_app')" :key="comp[0]" :forceRender="true">
        <sub-process-def-list :ref="comp[0]" :radio="radio" :groupId="groupId"
                             :initSelectedKeys="selectedRowKeys"
                             :initSelectedRows="selectionRows"
                             @setSelectedRowKeys = "setSelectedRowKeys"
                             @setSelectionRows = "setSelectionRows"
                             @selected="handleOk"></sub-process-def-list>
      </a-tab-pane>
      <a-tab-pane :tab="$t('m.eform.appgroup.other.common_app')" :key="comp[1]" :forceRender="true">
        <sub-process-def-common-list :ref="comp[1]" :radio="radio" :groupId="groupId"
                                    :initSelectedKeys="selectedRowKeys"
                                    :initSelectedRows="selectionRows"
                                    @setSelectedRowKeys = "setSelectedRowKeys"
                                    @setSelectionRows = "setSelectionRows"
                                    @selected="handleOk"></sub-process-def-common-list>
      </a-tab-pane>
    </a-tabs>

    <template slot="footer">
      <a-button key="back" @click="handleCancel">{{ $t('m.common.button.close') }}</a-button>
      <a-button key="handleClear" @click="handleClear">{{ $t('m.common.button.clear') }}</a-button>
      <a-button key="submit" type="primary" @click="handleOk">{{ $t('m.common.button.ok') }}</a-button>
    </template>

  </ych-modal>
</template>

<script>

  import SubProcessDefList from './list/SubProcessDefList';
  import SubProcessDefCommonList from './list/SubProcessDefCommonList'
  import { SelectDialogMixin } from '../../eform/select/dialog/SelectDialogMixin'

  export default {
    name: "SelectSubProcessDialog",
    mixins: [SelectDialogMixin],
    components: {
      SubProcessDefList,
      SubProcessDefCommonList
    },
    data() {
      return {
        title: this.$t('m.bpm.other.xuan-ze-liu-cheng-mo-ban'),
      }
    },
    methods: {}
  }
</script>
